package com.baizhi.abstractx2;

import java.util.Scanner;

public class ShapeTest {
    public static void main(String[] args) {
        //用户输入图形
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入您要计算的图形：");
        String s = scan.next();

        Shape shape = null;

        if(s.equals("长方形")){
           shape = new Rectangle();
        }else if(s.equals("圆形")){
            shape = new Round();
        }else if(s.equals("梯形")){
            shape = new Trapezoid();
        }else if(s.equals("三角形")){
            shape = new Triangle();

        }


        if(shape!=null){
            shape.inInfo(scan);
        }

    }
}
